import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:finance_app/src/utils/language_utils.dart';
import 'package:flutter/material.dart';

class NormalBlueTagWidget = RedTagWidget with _NormalBlueTagMixin;

mixin _NormalBlueTagMixin {
  final Color textColor = aceBlackColor;
  final Color borderColor = aceWhiteBlue;
  final Color backgroundColor = aceBlueColor;
  final FontWeight fontWeight = FontWeight.w400;
}

class BlueTagWidget = RedTagWidget with _BlueTagMixin;

mixin _BlueTagMixin {
  final Color textColor = aceBlueColor;
  final Color borderColor = aceLightBlue;
  final Color backgroundColor = aceBlueColor;
  final FontWeight fontWeight = FontWeight.w400;
}

class GreenTagWidget = RedTagWidget with _GreenTagMixin;

mixin _GreenTagMixin {
  final Color textColor = aceGreenColor;
  final Color backgroundColor = aceGreenColor;

  final Color borderColor = aceGreenColor5;
  final FontWeight fontWeight = FontWeight.w700;
}

mixin _RedTagMixin {
  final Color textColor = aceRedColor;
  final Color backgroundColor = aceRedColor;
  final Color borderColor = aceRedColor5;
  final FontWeight fontWeight = FontWeight.w700;
}

class NormalRedTagWidget = RedTagWidget with _NormalRedTagMixin;

mixin _NormalRedTagMixin {
  final Color textColor = aceBlackColor;
  final Color backgroundColor = aceRedColor;
  final Color borderColor = aceRedColor5;
  final FontWeight fontWeight = FontWeight.w400;
}

class RedTagWidget extends StatelessWidget with _RedTagMixin {
  final String content;

  RedTagWidget({Key key, this.content}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.symmetric(horizontal: getDp(10), vertical: getDp(3)),
      decoration: BoxDecoration(
          color: borderColor,
          borderRadius: BorderRadius.circular(getDp(10)),
          border: Border.all(color: backgroundColor, width: getDp(0.25))),
      child: Text(
        LanguageUtils.translateStatus(content),
        style: TextStyle(
          color: textColor,
          fontSize: getSp(12),
          fontWeight: fontWeight,
          height: 14 / 12,
        ),
      ),
    );
  }
}
